-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass through Lua code in script #495
Conversation
Hmm it looks like the only reason escape sequences aren't allowed currently is because of something I overlooked in the LPEG grammar. It should be possible to get them working properly so 100% of valid Lua code would be allowed, minus whatever the closing tag (or unmatched closing brace) is. |
I updated this to fix handling Lua string escape sequences (and remove the caveat about them from the docs). |
Refactoring the LPEG groups is going to be a different kind of job and out of scope for this PR, so I'm nixing that item. It looks like the right way to do that is to compress the tree one more level than it is (so what is now passed around as I've tested this on my own machine and the metrics I get for the current master branch. This doesn't seem to introduce any new regressions. |
With different types of stuff being processed differently (passthrough in an environment, passthrough in a command, and normal) the "stuff" category got a more specific name. I missed one place it was referenced.
This allows the literal characters
%
and balanced pairs of{
}
to appear in either command (\script{...}
) or environment (\begin{script}...\end{script}
) forms of the script command and be passed through as-is to Lua for evaluation.Todo before merging:
Refactor LPEG capture groups or add AST tree cleanup so we're not passing as many arbitrary data types further down the parsing pipeline than we need to be.This will close #450 and closes #92.